/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-02-27     chengjili       the first version
 */
#ifndef BOARD_USER_DRV_INC_USER_ADC_H_
#define BOARD_USER_DRV_INC_USER_ADC_H_


#include <rtthread.h>
#include "board.h"

#ifdef __cplusplus
extern "C" {
#endif

#if defined(BSP_USING_USER_ADC1) || defined(BSP_USING_USER_ADC2)

typedef struct __user_adc_device
{
    struct rt_device parent;
}user_adc_device, *user_adc_device_t;

typedef struct __user_adc_regular_channel
{
    uint8_t channel;
    GPIO_Module *GPIOX;
    uint16_t GPIO_Pin;
}user_adc_regular_channel, *user_adc_regular_channel_t;

typedef struct __user_adc_config
{
    user_adc_device n32_adc_device;
    ADC_Module *ADC_Handler;
    char *name;
    uint32_t RCC_APB2_PERIPH_GPIOX;
    user_adc_regular_channel regular_channels[];
}user_adc_config, *user_adc_config_t;

#endif


#ifdef __cplusplus
}
#endif

#endif /* BOARD_USER_DRV_INC_USER_ADC_H_ */
